//
//  PendApprovalInfoSPInfoMationTableViewCell.m
//  ZJControlsClass
//
//  Created by apple on 2024/11/2.
//

#import "PendApprovalInfoSPInfoMationTableViewCell.h"

@interface PendApprovalInfoSPInfoMationTableViewCell ()

@property (nonatomic,strong) UIImageView * img;



@end



@implementation PendApprovalInfoSPInfoMationTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        [self configUI];
        
    }
    return self;
}

-(void)configUI{
    
    [self.contentView addSubview:self.img];
    [self.contentView addSubview:self.typeLabel];
    [self.contentView addSubview:self.typeOneLabel];
    [self.contentView addSubview:self.msgLabel];
    [self.contentView addSubview:self.timeLabel];
    [self.contentView addSubview:self.seeBtn];
    
    [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).with.offset(ALIGN_HEIGHT_PT(20));
        make.left.equalTo(self.contentView).with.offset(ALIGN_WIDTH_PT(30));
        make.size.equalTo(@(CGSizeMake(11, 11)));
    }];
    
    [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.img.mas_centerY);
        make.left.equalTo(self.img.mas_right).with.offset(ALIGN_WIDTH_PT(10));
    }];
    
    [self.typeOneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.typeLabel.mas_centerY);
        make.left.equalTo(self.typeLabel.mas_right).with.offset(ALIGN_WIDTH_PT(10));
    }];
    
    [self.msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.typeLabel.mas_bottom).with.offset(ALIGN_HEIGHT_PT(15));
        make.left.equalTo(self.typeLabel.mas_left);
    }];
    
    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.msgLabel.mas_bottom).with.offset(ALIGN_HEIGHT_PT(15));
        make.left.equalTo(self.typeLabel.mas_left);
    }];
    
    [self.seeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.msgLabel.mas_centerY);
        make.left.equalTo(self.msgLabel.mas_right).with.offset(ALIGN_WIDTH_PT(10));
    }];
    
}




#pragma mark -- 懒加载
-(UIImageView *)img{
    if (!_img) {
        _img = [UIImageView new];
        _img.image = [UIImage imageNamed:@""];
        _img.backgroundColor = COLOR_RGB(50, 113, 237);
        _img.layer.cornerRadius = 11 / 2;
        _img.layer.masksToBounds = YES;
    }
    return _img;
}
-(UILabel *)timeLabel{
    if (!_timeLabel) {
        _timeLabel = [UILabel new];
        _timeLabel.text = @"2024.03.06 11:00";
        _timeLabel.font = FONT12;
        _timeLabel.textColor = COLOR_RGB(153, 153, 153);
        _timeLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _timeLabel;
}

-(UILabel *)typeLabel{
    if (!_typeLabel) {
        _typeLabel = [UILabel new];
        _typeLabel.text = @"提交";
        _typeLabel.font = FONT14;
        _typeLabel.textColor = [UIColor blackColor];
        _typeLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _typeLabel;
}

-(UILabel *)typeOneLabel{
    if (!_typeOneLabel) {
        _typeOneLabel = [UILabel new];
        _typeOneLabel.text = @"提交";
        _typeOneLabel.font = FONT12;
        _typeOneLabel.textColor = [UIColor whiteColor];
//        _typeOneLabel.backgroundColor = COLOR_RGB(153, 153, 153);
        _typeOneLabel.textAlignment = NSTextAlignmentCenter;
        _typeOneLabel.layer.cornerRadius = 2;
        _typeOneLabel.layer.masksToBounds = YES;
    }
    return _typeOneLabel;
}

-(UILabel *)msgLabel{
    if (!_msgLabel) {
        _msgLabel = [UILabel new];
        _msgLabel.text = @"申办单位证件签署人";
        _msgLabel.font = FONT14;
        _msgLabel.textColor = [UIColor blackColor];
        _msgLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _msgLabel;
}

-(UIButton *)seeBtn{
    if (!_seeBtn) {
        _seeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"查看详情 >  " attributes: @{
            NSFontAttributeName: [UIFont fontWithName:@"PingFang SC" size: 12],
            NSForegroundColorAttributeName: [UIColor colorWithRed:50/255.0 green:113/255.0 blue:237/255.0 alpha:1],
            NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle)
        }];
        [_seeBtn setAttributedTitle:string forState:(UIControlStateNormal)];
        _seeBtn.hidden = YES;
    }
    return _seeBtn;
}



@end
